<%@ page contentType="text/html;charset=UTF-8" import="java.util.Enumeration" language="java"%>
<%@ page import="java.util.Objects" %>
<!DOCTYPE html>
<html>
<head>
<title>隐含对象pageContext</title>
</head>
<body>
  pageContext是PageContext类的实例
  <br>
  <%
      Enumeration<String> names = request.getParameterNames();
      out.print("获取为pageContext设置的属性<br>");
      while (names.hasMoreElements()) {
          String attr = request.getParameter(names.nextElement());
          Object val = pageContext.getAttribute(attr);
          if (Objects.nonNull(val)) {
              out.print(attr + "：" + val + "<br>");
          }
      }
      out.print("为隐含对象application设置属性");
      application.setAttribute("apache", "tomcat");
  %>
</body>
</html>
